import { Route, Routes, Navigate } from "react-router";
import Layout from "./layout";
import Mycourse from './views/mycourse/index'
import Mystudent from './views/mystudent/index'
import Detection from './views/detection/index'
import Help from './views/Help/index'
import CourseManage from './views/courseManage/index'
import Setup from './views/setup/index'
import UserInfo from './views/setup/userinfo'
import Aboutus from './views/setup/aboutus'
import Security from './views/setup/security'
import Error from './views/error'
import UpGradation from './views/upgradation/index'
import Home from './views/home'
import Classroom from "./views/home/classroom";
import Login from './views/login'
import Person from './views/person/index'
import ScreenRecord from './views/mycourse/screenrecord'
import WaitClass from './views/mycourse/waitclass'
import Freetime from './views/mycourse/freetime'

const App = () => {
  return (
    <>
      <Routes>
        {/* <Route path='/' element={<Navigate to='/home' />}></Route> */}
        <Route path="/" element={<Layout />}>
          <Route path="/" element={<Navigate to='/home' />}></Route>
          <Route path="/home" element={<Home />}></Route>
          <Route path="/coursemanage" element={<CourseManage />}></Route>
          <Route path="/mystudent" element={<Mystudent />}></Route>
          <Route path="/detection" element={<Detection />}></Route>
          <Route path="/help" element={<Help />}></Route>
          <Route path="/person" element={<Person />}></Route>
          {/* 我的课程 */}
          <Route path="/mycourse" element={<Mycourse />}>
            <Route path="/mycourse" element={<Navigate to='/mycourse/waitclass' />}></Route>
            <Route path="/mycourse/waitclass" element={<WaitClass />}></Route>
            <Route path="/mycourse/screenrecord" element={<ScreenRecord />}></Route>
            <Route path="/mycourse/freetime" element={<Freetime />}></Route>
          </Route>
          {/* 设置 */}
          <Route path="/setup" element={<Setup />}>
            <Route path="/setup" element={<Navigate to='/setup/userinfo' />}></Route>
            <Route path="/setup/userinfo" element={<UserInfo />}></Route>
            <Route path="/setup/security" element={<Security />}></Route>
            <Route path="/setup/aboutus" element={<Aboutus />}></Route>
          </Route>
        </Route>
        <Route path="/upgradation" element={<UpGradation />}></Route>
        <Route path="/login" element={<Login />}></Route>
        <Route path="/classroom" element={<Classroom />}></Route>
        <Route path="*" element={<Error />}></Route>
      </Routes >
    </>
  );
};
export default App;
